<template>
  <div class="dashboard-container">
    <div class="dashboard-text">早上好: {{ name }}</div>
    <div class="w">
      <el-carousel height="460px">
        <el-carousel-item v-for="(item, index) in list_img" :key="index">
          <h3 class="small">
            <img :src="item.url" alt />
          </h3>
        </el-carousel-item>
      </el-carousel>
    </div>
  </div>
</template>

<script>
import { mapGetters } from "vuex";

export default {
  name: "Dashboard",
  data() {
    return {
      list_img: [
        { url: require('../../assets/banner/banner_1.jpg') },
        { url: require('../../assets/banner/banner_2.jpg') },
        { url: require('../../assets/banner/banner_3.jpg') },
        { url: require('../../assets/banner/banner_4.jpg') },
        { url: require('../../assets/banner/banner_5.jpg') },
      ],
    }
  },
  computed: {
    ...mapGetters(["name"]),
  },
};
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
.w {
  margin: 0 auto;
  width: 1226px;
}

.el-carousel__item h3 {
  color: #475669;
  font-size: 14px;
  opacity: 1;
  line-height: 300px;
  margin: 0;
  text-align: center;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n + 1) {
  background-color: #d3dce6;
}

.small img {
  width: 100%;
  height: 100%;
}

.el-carousel__container {
  width: 1226px;
  height: 460px;
}
</style>
